//
//  MBaseService.m
//  ios-test
//
//  Created by Apple -11 on 15/10/24.
//  Copyright (c) 2015年 Apple -11. All rights reserved.
//

#import "MBaseService.h"
#import "Define.pch"
@implementation MBaseService
+(id)sharedHTTPClient{
    AFHTTPClient *shared_instance;
    shared_instance = [AFHTTPClient clientWithBaseURL:[NSURL URLWithString:BASE_SERVER_URL]];
    [shared_instance registerHTTPOperationClass:[AFJSONRequestOperation class]];
    [shared_instance setDefaultHeader:@"Accept" value:@"application/json"];
    shared_instance.parameterEncoding=AFJSONParameterEncoding;
    return shared_instance;
}
+(id)sharedClient{
    static dispatch_once_t pred;
    static MBaseService *shared_instance =nil;
    
    
    dispatch_once(&pred,^{
        shared_instance=[[self alloc]init];
        shared_instance.client=[self sharedHTTPClient];
    });
    return shared_instance;
}

@end
